#include<iostream>
using namespace std;
const int N = 1e5, M = 2 * 1e6 + 10;
int h[N], e[M], ne[M], idx;
int color[N];
int n, m;
void add(int a, int b)
{
	e[idx] = b;
	ne[idx] = h[a];
	h[a] = idx++;
}
bool dfs(int u, int c)
{
	color[u] = c;
	for (int i = h[u]; ~i; i = ne[i]) {
		int j = e[i];
		if (!color[j]) {
			if (!dfs(j, 3 - c))return 0;
		}
		else if (color[j] == c) {
			return 0;
		}
	}
	return 1;
}
int main()
{
	cin >> n >> m;
	memset(h, -1, sizeof(h));
	while (m--) {
		int a, b;
		cin >> a >> b;
		add(a, b);
		add(b, a);
	}
	bool flag = 1;
	for (int i = 1; i <= n; i++) {
		if (!color[i]) {
			if (!dfs(i, 1)) {
				flag = 0;
				break;
			}
		}
	}
	puts(flag ? "yes" : "no");
	return 0;
}